package edu.johnpank.libassistant.repo

import edu.johnpank.libassistant.entity.User
import org.springframework.data.repository.CrudRepository
import org.springframework.stereotype.Repository
import java.util.Optional

@Repository
interface UserRepository: CrudRepository<User?, Long> {

    override fun findAll(): MutableIterable<User>

    fun findByLoginAndEmailAndFirstNameAndLastName(login: String, email: String, firstName: String, lastName: String): MutableIterable<User>
    fun findByLoginContainingOrFirstNameContaining(login: String, firstName: String): MutableIterable<User>

    override fun findById(id: Long): Optional<User?>

//    fun findByEmail(email: String): User?

    fun findByLogin(login:String): Optional<User>

//    fun findByNameContainingIgnoringCase(name: String?): List<User>?

}